import com.twitter.processing.*;
import java.util.ArrayList;

//ControlP5 controlP5;
TrendMap map;

public int chicagoCount;
public int newYorkCount;
public int losAngelesCount; 
public String currentDateTime="THE DATE HERE";  
public int[] stateCounts = new int[50];
//public ArrayList<TweetTime> livePastTenMin = new ArrayList<TweetTime>();
//public int[] pastTenCount = new int[50];
public String[] stateNames = {"alabama", "alaska", "arizona", "arkansas", "california", "colorado", "connecticut", "deleware", "florida", 
                              "georgia", "hawaii", "idaho", "illinois", "indiana", "iowa", "kansas", "kentucky", "louisiana", "maine", "maryland", "massachusetts", 
                              "michigan", "minnesota", "mississippi", "missouri", "montana", "nebraska", "nevada", "new hamshire", "new jersey", 
                              "new mexico", "new york", "north carolina", "north dakota", "ohio", "oklahoma", "oregon", "pennsylvania", 
                              "rhode island", "south carolina", "south dakota", "tennessee", "texas", "utah", "vermont", "virginia", 
                              "washington", "west virginia", "wisconsin", "wyoming"};
                              
// This string holds the help and description information
static final String mapInfo = "Map: The map display type\n"
             +"shows tweets in a geo-spatial form.\n"
             +"You have the choice of viewing tweets\n"
             +"either from November 2010 (last week)\n"
             +"or live, as they are happening right now.\n\n"
             +"TO GET STARTED: Choose either November\n"
             +"2010 or LIVE from the dropdown list.";

int streamChoice = 2;
void initStateCounts(){
for (int i = 0; i<50; i++){
  stateCounts[i] = 0;
 // pastTenCount[i] = 0;
}
  
}

void setupMap()
{
int streamChoice = 2; //live=2 local=1
map = new TrendMap(this);
}

void tweet(Status tweet) {
    String location = tweet.user().location();
    location = "z"+location; //so the first index cant be zero;
    for (int i = 0; i<50; i++){
      if (location.toLowerCase().indexOf(stateNames[i])>0){
        stateCounts[i]++;
        //livePastTenMin.add(new TweetTime(i));
       // pastTenCount[i]++;
        }
      }
  // print a message to the console just for giggles if you like
  // println("got tweet " + tweet.id());

  // store the latest tweet text
  // bump our tweet count by one
 }
 
void drawMap()
{
  
  map.drawTrendMap();
  showDescriptionBox(mapInfo);
}
